<%@ page language="java" pageEncoding="utf-8" import="com.ckeditor.*,model.bo.Contentus,java.util.*;"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <jsp:include flush="true" page="_header.jsp"></jsp:include>
  <body class="bgwhite">
  	<logic:notEmpty name="successMessage">
   		<p class="successMessage">
    		<bean:write name="successMessage" />
    	</p>
    	<script type="text/javascript">
    	if($(".successMessage").length!=0){
    		window.setTimeout(function(){
    			$(".successMessage").hide();
    		},3000)
    	}
    	</script>
    </logic:notEmpty>
  	<logic:empty name="content">
  		<blockquote class="msg-info">
			<h3>服务器发生错误</h3>
			<p>没有查询到任何文章或栏目暂时未开放。</p>
		</blockquote>
  	</logic:empty>
  	<logic:notEmpty name="content">
  		<%
		  	Contentus obj = (Contentus)request.getAttribute("content");
		  	String contentValue = obj.getContentvalue();
	    %>
	  	<form id="frmcontent" name="frmcontent" method="post" action="<%=request.getContextPath()%>/admin.do?action=updatecontentus">
	  	<input type="hidden" name="org.apache.struts.taglib.html.TOKEN" value= "<%=session.getAttribute("org.apache.struts.action.TOKEN")%>"/>
	  	<div class="pannel">
		  	<% 
		        Map<String, String> attr = new HashMap<String, String>();
	            CKEditorConfig settings = new CKEditorConfig();
	            settings.addConfigValue("toolbar","[['Source','-','Bold','Italic','Strike','-','RemoveFormat' ],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],[ 'TextColor','BGColor' ], [ 'Find','Replace','-','SelectAll','-','Scayt' ],[ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ], [ 'Link','Unlink','Anchor' ], [ 'Image','HorizontalRule','PageBreak' ]]");
	            settings.addConfigValue("width", "98%");
	            settings.addConfigValue("height", "385px");
	            settings.addConfigValue("name","contentus");
	            settings.addConfigValue("filebrowserUploadUrl","ckUpload.do?action=unspecified&type=file");
				settings.addConfigValue("filebrowserImageUploadUrl","ckUpload.do?action=unspecified&type=file");
				settings.addConfigValue("filebrowserFlashUploadUrl","ckUpload.do?type=Flash");
				//瀏览图片
				settings.addConfigValue("filebrowserImageBrowseUrl","browerServer.do?type=image");
			%>
			<ckeditor:editor textareaAttributes="<%=attr%>" basePath="./ckeditor/" config="<%=settings%>" editor="contentus" value="<%=contentValue%>"/>
			<p class="controlbar">
				<a target="iFrame1" onclick="document.getElementById('frmcontent').submit();">提交</a>
			</p>
	  	</div>
	  	</form>
  	</logic:notEmpty>
  </body>
</html>